
/**
 * return -1 : date1<date2
 * return  0 : date1=date2
 * return  1 : date1>date2
 */
function compareDate(date1, date2) {
	if (date1.getTimes() < date2.getTimes()) {
		return -1;
	} else if(date1.getTimes() > date2.getTimes()) {
		return 1;
	} else {
		return 0;
	}
}

/**
 * 功能：比较日期大小
 * 描述：date1开始日期，date2结束日期，时间格式为2009-2-26 11:30，并且不能为空
 *      true表示正确，false表示错误
 */
function dateBigSmallEqual(date1,date2) {
	var v_s = date1;
	var v_e = date2;
	var v_startdate;
	var v_enddate;

	if(v_s.length > 0 && v_e.length > 0) {
		v_startdate = v_s.replace("-","");
		v_startdate = v_startdate.replace("-","");
		v_startdate = v_startdate.replace(" ","");
		v_startdate = v_startdate.replace(":","");
		v_startdate = v_startdate.replace(":","");

		v_enddate = v_e.replace("-","");
		v_enddate = v_enddate.replace("-","");
		v_enddate = v_enddate.replace(" ","");
		v_enddate = v_enddate.replace(":","");
		v_enddate = v_enddate.replace(":","");

		if(v_startdate >= v_enddate) {
			return false;
		} else {
			return true;
		}
	}
	return true;
}